/**
 * 
 */
package com.dhcc.frame.lang3.reflect;

import org.apache.commons.lang3.reflect.InheritanceUtils;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.dhcc.frame.lang3.Person;
import com.dhcc.frame.lang3.Student;

/**
 * @author 谢进军
 *
 */
public class InheritanceUtilsTest {
	private Logger logger = LoggerFactory.getLogger( InheritanceUtilsTest.class );
	@Test public void testInheritanceUtils(){
		int int1 = InheritanceUtils.distance(Student.class, Object.class);
		logger.info( String.valueOf( int1 ) );//2
		int int2 = InheritanceUtils.distance(Person.class, Object.class);
		logger.info( String.valueOf( int2 ) );//1
		
		int int3 = InheritanceUtils.distance(null, Object.class);
		logger.info( String.valueOf( int3 ) );//-1
		
		int int4 = InheritanceUtils.distance(Student.class, null);
		logger.info( String.valueOf( int4 ) );//-1
		
		int int5 = InheritanceUtils.distance(Object.class, Object.class);
		logger.info( String.valueOf( int5 ) );//0
	}
}
